﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucProductDetail.ascx.cs" Inherits="TTMarketing.UserControl.SanPham.ucProductDetail" %>
<%@ Register src="ucGetByCate.ascx" tagname="ucGetByCate" tagprefix="uc1" %>
<%@ Register src="ucProductOrther.ascx" tagname="ucProductOrther" tagprefix="uc2" %>
<asp:ObjectDataSource ID="odsNews" runat="server" SelectMethod="getById" 
    TypeName="TTBusiness.ClassDB.clsBSProduct">
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="" Name="id" QueryStringField="id" 
            Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<%--<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                         SelectMethod="Attribute_getByProductId" 
                         TypeName="TTBusiness.ClassProject.clsBSBusiness">
    <SelectParameters>
        <asp:QueryStringParameter Name="productid" QueryStringField="id" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<asp:DataList ID="DataList1" runat="server" 
                         DataSource='<%# Eval("tblProduct_Attributes") %>' 
                         DataSourceID="ObjectDataSource1">
    <ItemTemplate>
        <asp:Label ID="Label5" runat="server" 
                                 
            Text='<%# Eval("tblCate_Attribute.tblAttribute.Name") %>'></asp:Label>
        &nbsp;:
        <asp:Label ID="Label4" runat="server" Text='<%# Eval("Value") %>'></asp:Label>
        <br />
    </ItemTemplate>
</asp:DataList>--%>
<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="odsNews" 
    BorderWidth="0px" ItemPlaceholderID="ph" AllowPaging="True" PageSize="15" 
    Width="100%" onitemcommand="RadListView1_ItemCommand">
    <LayoutTemplate>
        <asp:PlaceHolder runat="server" id="ph" />
    </LayoutTemplate>
    <ItemTemplate>
         <table width="100%">
             <tr>
                 <td width="200px" valign="top">
                     <asp:Image ID="Image1" runat="server" Height="150px" 
                         ImageUrl='<%# "~/Image/Upload/"+Eval("Image") %>' Width="200px" />
                 </td>
                 <td align="left" valign="top">
                 <span style="font-size:16px; font-weight:bold;">
                     Tên sản phẩm :&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                     &nbsp;<asp:Label ID="Label2" runat="server" Text='<%# "("+Eval("SeriNumber")+")" %>'></asp:Label>
                     </span>
                     <br />
                     <%
                         TTBusiness.ClassProject.clsBSBusiness obj = new TTBusiness.ClassProject.clsBSBusiness();
                         foreach (var item in obj.Attribute_getByProductId(Convert.ToInt32(Request.QueryString["id"])))
                         {
                             %>
                             <%=item.tblCate_Attribute.tblAttribute.Name %> : <%=item.Value %><br />
                             
                             <%
                         }
                          %>
                          <br />
                     Loại :
                     <asp:Label ID="Label9" runat="server" 
                         Text='<%# Eval("tblCate_Factory.tblCateProduct.tblTypeProduct.Name") %>'></asp:Label>
                     <br />
                     Chức năng :
                     <asp:Label ID="Label8" runat="server" Text='<%# Eval("tblCate_Factory.tblCateProduct.Name") %>'></asp:Label>
                     
                     <br />
                     <asp:Label ID="Label6" runat="server" Text='<%# Eval("Summary") %>'></asp:Label>
                     <br />
                     <span style="font-size:15px;  font-weight:bold;">
                     Giá :
                     <asp:Label ID="Label3" runat="server" Text='<%# Eval("Price", "{0:N0}") %>'></asp:Label> VNĐ
                     <%#
                         Convert.ToInt32(Eval("Sale")) > 0 ? "<br/>Giá sale :" + Eval("Sale", "{0:N0}") + " VNĐ" : ""
                         %>
                     </span>
                     <br />
                     <br />
                     <asp:ImageButton ID="btnMua" runat="server" 
                         ImageUrl="~/Style/Image/dat-mua.png" 
                         CommandArgument='<%# Eval("ID") %>' CommandName="Mua" />
                 </td>
             </tr>
             <tr>
                 <td colspan="2">
                     <asp:Label ID="Label7" runat="server" Text='<%# Eval("Detail") %>'></asp:Label>
                 </td>
             </tr>
             <tr>
                 <td colspan="2">
                     Sản phẩm cùng loại</td>
             </tr>
             <tr>
                 <td colspan="2">
                     <uc2:ucProductOrther ID="ucProductOrther1" runat="server" />
                 </td>
             </tr>
        </table>
    </ItemTemplate>
    <EmptyDataTemplate>
        <div class="RadListView RadListView_Default">
            <div class="rlvEmpty">
                Dữ liệu đang cập nhật</div>
        </div>
    </EmptyDataTemplate>
    
</telerik:RadListView>

